<template>
  <input 
  class="input09"
    type="text" 
    ref="input"
    :value="value"    
    @input="result($event)"
    >
</template>
<style>
.input09{
    display: block;
    resize: vertical;
    padding: 5px 15px;
    line-height: 1.5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    font-size: inherit;
    text-align: center;
    color: #606266;
    background-color: #fff;
    background-image: none;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
}
</style>

<script>
export default {
  name: "input09",
  props: ['text', 'value'],
  meta:{
    descr:"询价系统-查看方案"
  },
  data() {
    return {
     
    };
  },
  methods: {
      result(d){
        let that=this;
        
        if(isNaN(d.target.value)){
            d.target.value=that.value;
            that.$emit('input',that.value);
        }
        else if(d.target.value.indexOf(".")!==1){
            that.$emit('input', d.target.value);
        }
        else if(d.target.value===0){
            that.$emit('input', d.target.value);
        }
        else{that.$emit('input', d.target.value);}
      }
  },
  created(){

  }
};
</script>